import React from 'react';
import Compare from '../../../../components/Compare';
import Com from './com';
import { OPER_TYPE } from '../../../../utils/constant';

export default function PublishCompare(props) {
  const { afterContent, onlineList, operType } = props

  return (
    <Compare
      com1={
        <div>
          <Com
            {...props}
            value={afterContent || {}}
            actionType='detail'
            isImport={operType === OPER_TYPE._INPORT ? true : false}
            isImportant={operType === OPER_TYPE._INPORT}
            type={1}
          />
        </div>
      }
      com2={onlineList[0] &&
        <div>
          <Com
            {...props}
            value={onlineList[0]}
            actionType='detail'
            isImport={operType === OPER_TYPE._INPORT ? true : false}
            isImportant={operType === OPER_TYPE._INPORT}
            type={2}
          />
        </div>
      }
      com3={onlineList[1] &&
        <div>
          <Com
            {...props}
            value={onlineList[1]}
            actionType='detail'
            isImport={operType === OPER_TYPE._INPORT ? true : false}
            isImportant={operType === OPER_TYPE._INPORT}
            type={2}
          />
        </div>
      }
      operType={operType && operType}
    />
  );
}
